	//结案面板
	var settleCasePanel;
	//结案窗口
	var settleCaseWin;
	//接收原文件传过来的存储器
	var stores;
	//结案处理函数
	function settleCaseFun(grid ,store){
		stores=store;
	var record = grid.getSelectionModel().getSelected();
        if (!record) {
           Ext.MessageBox.alert('结案操作','请选择要结案的一项！');
        } else {
            settleCaseWin=new Ext.Window({
				layout : 'fit',
                width : 400,
                height : 300,
                closeAction : 'hide',
                plain : true,
                title : '结案窗口',
                items : settleCasePanel
		})
              Ext.getCmp("settleCaseId").setValue(record.get("contractnumber"));
              Ext.getCmp("settleDeposit").setValue(record.get("archivedeposit"));
              Ext.getCmp("settleUnderLawyer").setValue(record.get("undertakelawyer"));
              settleCaseWin.show();
	}
	}

		settleCasePanel=new Ext.form.FormPanel({
		collapsible : true,
        labelWidth :100,
        labelAlgin:'right',
        frame : true,
        bodyStyle : 'padding:5px 5px 0',
        buttonAlign:'center',//按钮居中
        waitMsgTarget : true,
        defaults : {
            width : 200
        },
        defaultType : 'textfield',

        items : [
        {
         	xtype:'hidden',
            name :'settleCaseId',
            id:"settleCaseId"

        },
         {
         	xtype:'hidden',
            name :'settleUnderLawyer',
            id:"settleUnderLawyer"

        },
        {
            fieldLabel : '卷宗押金情况',
            name :'settleDeposit',
            id:"settleDeposit",
            allowBlank : false
        },
         {
         	inputType:'password',
            fieldLabel : '签名',
            name :'settlepassWord',
            id:"settlepassWord",
            allowBlank : false
        }
        ],

        buttons : [ {
            text : '结案',
            iconCls:'confirm',
            disabled : false,
            handler : function() {
                if (settleCasePanel.form.isValid()) {
                    settleCasePanel.form.submit( {
                        url :'SettleCase.jsj',
                        success : function(from, action) {
                         Ext.MessageBox.alert('结果', action.result.message);
                            stores.load( {
                                params : {
                                    start : 0,
                                    limit : 5
                                }
                            });
                            settleCaseWin.hide();
                        },
                        failure : function(form, action) {
                           Ext.MessageBox.alert('结果', action.result.message);
                           stores.load( {
                                params : {
                                    start : 0,
                                    limit : 5
                                }
                            });
                           settleCaseWin.hide();
                        },
                        waitMsg : '正在发送请求，稍后...'
                    });
                } else {
                    Ext.Msg.alert('信息', '请填写完成再提交!');
                }
            }
        }, {
            text : '取消',
            iconCls:'cancel',
            handler : function() {
                settleCaseWin.hide();
            }
        }]
		})
